﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CampaignRecipientViewModel>" %> 

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Campaign Recipients
</asp:Content>

<asp:Content ID="ContentHeader" ContentPlaceHolderID="ContentHeader" runat="server">
Campaign: <%= Html.Encode(Model.Campaign.CampaignName) %>
</asp:Content>

<asp:Content ID="ContentSubNav" ContentPlaceHolderID="ContentSubNav" runat="server">
    <li class="selected"><%= Html.ActionLink("Index", "Index", "Campaign")%></li>
    <li><%= Html.ActionLink("Create", "Create", "Campaign")%></li>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">


<div class="clearfix" style="border-bottom:2px solid red;margin:0 0 10px;padding:0 0 15px;">
    
    <a id="filterBtn">Filter</a>
    
    <input type="submit" class="clearBtn" value="Clear Filter" onClick="location.href='<%= Url.Action((string)null) %>';return false;">
    
    <div id="filterContainer">
        <div class="faux_form">
            <% Html.RenderPartial("FilterForm", "filter"); %>   
        </div>
    </div>
</div>

<%= Html.ActionLink("Download", "DownloadRecipients", this.ViewContext.GetAllExistingRouteValues(), new Dictionary<string, object>{{"Title", "Download"}, {"Class", "btnDownload"}})%>

<table>
    <thead>
        <tr>
            <th><%= Html.ColumnHeader("First name", new SortExpression<CampaignUser>().SortDesc(x => x.Customer.FirstName))%></th>
            <th><%= Html.ColumnHeader("Last name", new SortExpression<CampaignUser>().SortDesc(x => x.Customer.LastName))%></th>
            <th><%= Html.ColumnHeader("Email", new SortExpression<CampaignUser>().SortDesc(x => x.Customer.Email))%></th>
            <th><%= Html.ColumnHeader("Response", new SortExpression<CampaignUser>().SortDesc(x => x.CustomerResponse))%></th>
        </tr>
    </thead>
    <tbody>
   <% foreach (var campaignUser in Model.Recipients){%>
    <tr>
        <td><%= Html.Encode(campaignUser.Customer.FirstName)%></td>
        <td><%= Html.Encode(campaignUser.Customer.LastName)%></td>
        <td><%= Html.Encode(campaignUser.Customer.Email)%></td>
        <td><%= Html.Encode(campaignUser.CustomerResponse)%></td>
    </tr>
    <%}%>
    </tbody>
</table> 

<%= Html.PagingDiv(Model.Recipients)%>
</asp:Content>
